package com.lhb.aicodemother.service;


import com.lhb.aicodemother.model.dto.user.UserQueryRequest;
import com.lhb.aicodemother.model.entity.User;
import com.lhb.aicodemother.model.vo.LoginUserVo;
import com.lhb.aicodemother.model.vo.UserVo;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.service.IService;
import jakarta.servlet.http.HttpServletRequest;

import java.util.List;

/**
 * 用户 服务层。
 *
 * @author lihai
 */
public interface UserService extends IService<User> {

    /*
    * 用户注册
    * */
    long userRegister(String userAccount, String userPassword,String checkPassword);

    /*
    * 用户登录
    * */
    LoginUserVo userLogin(String userAccount, String userPassword, HttpServletRequest request);

    /*
    * 用户注销
    * */
    boolean userLogout(HttpServletRequest request);

    /*
    * 获取加密后的密码
    * */
    String getEncryptPassword(String userPassword);

    /*
    * 获取脱敏的已登录用户信息
    * */
    LoginUserVo getLoginUserVo(User user);

    /*
    * 获取当前登录用户
    * */
    User getLoginUser(HttpServletRequest request);

    /*
    * 获取脱敏的用户信息
    * */
    UserVo getUserVo(User user);

    /*
    * 获取脱敏的用户列表信息
    * */
    List<UserVo> getUserVoList(List<User> users);

    /*
    * 将用户查询的请求转换为QueryWrapper
    * */
    QueryWrapper getQueryWrapper(UserQueryRequest userQueryRequest);
}
